{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Cognitive Reflection & COVID-19 Misinformation (Paper Replication Code)\n",
    "- Paper Title: \"_Cognitive reflection is associated with greater truth discernment for COVID-19 headlines, less trust but greater use of formal information sources, and greater willingness to pay for masks among social media users in Pakistan_\"\n",
    "- Authors: Dr. Ayesha Ali and Dr. Ihsan Ayyub Qazi\n",
    "- Affiliation: Lahore University of Management Sciences (LUMS), Pakistan\n",
    "- Email: ayeshaali@lums.edu.pk, ihsan.qazi@lums.edu.pk\n",
    "- Note: This notebook contains the python code to replicate the results of the paper."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import math\n",
    "import random\n",
    "import seaborn as sns\n",
    "import statsmodels.api as sm\n",
    "import statsmodels.formula.api as smf\n",
    "from sklearn.linear_model import LinearRegression\n",
    "from scipy import stats"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Main Code and Data Analysis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "metadata": {},
   "outputs": [],
   "source": [
    "user = pd.read_csv('covid-dataset.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of rows/observations in the dataset    :  621\n",
      "\n",
      "** Demographics **\n",
      "Mean age                                      :  29.33977455716586\n",
      "Mean gender (0 male, 1 female)                :  0.5040257648953301\n",
      "Mean education level                          :  2.252818035426731\n",
      "Mean income (household expenditure)           :  35575.69565217391\n",
      "\n",
      "** Truth Discernment & Perceived Accuracy **\n",
      "Mean discernment across 621 respondents [-1,1]:  0.7926922781400981\n",
      "Mean accuracy of true news [0,1]              :  0.9804079441867958\n",
      "Mean accuracy of false news [0,1]             :  0.18771566604347845\n",
      "\n",
      "** Trust in Sources **\n",
      "Mean trust score - across SM platforms        :  2.7762020529513807\n",
      "Mean trust score - across non-SM sources      :  2.8309878587251656\n",
      "\n",
      "** Sources and Frequency of Receiving COVID Info **\n",
      "Mean freq. of rcv COVID-19 info from non-SM   :  0.24801677489610371\n",
      "Mean freq. of rcv COVID-19 info from SM       :  0.5875805152979066\n",
      "\n",
      "** CRT **\n",
      "Mean score for CRT-1                          :  0.534621578099839\n",
      "Mean score for CRT-2                          :  0.46537842190016104\n",
      "Mean CRT score                                :  0.5\n",
      "\n",
      "** COVID-19 Behaviors **\n",
      "Mean surgical mask ownership                  :  0.7423510466988728\n",
      "Mean KN95 mask ownership                      :  0.03864734299516908\n",
      "Mean multiple mask ownership (masks owned)    :  0.8985507246376812\n",
      "Mean WTP for KN95 mask                        :  96.99677938808374\n"
     ]
    }
   ],
   "source": [
    "print(\"Number of rows/observations in the dataset    : \", len(user))\n",
    "\n",
    "print(\"\\n** Demographics **\")\n",
    "print(\"Mean age                                      : \", user['age'].mean())\n",
    "print(\"Mean gender (0 male, 1 female)                : \", user['gender'].mean())\n",
    "print(\"Mean education level                          : \", user['edu'].mean())\n",
    "print(\"Mean income (household expenditure)           : \", user['income'].mean())\n",
    "\n",
    "print(\"\\n** Truth Discernment & Perceived Accuracy **\")\n",
    "print(\"Mean discernment across 621 respondents [-1,1]: \", user['discern'].mean())\n",
    "print(\"Mean accuracy of true news [0,1]              : \", user['true_acc'].mean())\n",
    "print(\"Mean accuracy of false news [0,1]             : \", user['false_acc'].mean())\n",
    "\n",
    "print(\"\\n** Trust in Sources **\")\n",
    "# responsdent-level mean scores across source types (social media platforms & formal non-SM sources)\n",
    "print(\"Mean trust score - across SM platforms        : \", user['trust'].mean())\n",
    "print(\"Mean trust score - across non-SM sources      : \", user['trust_nonsm'].mean())\n",
    "\n",
    "print(\"\\n** Sources and Frequency of Receiving COVID Info **\")\n",
    "print(\"Mean freq. of rcv COVID-19 info from non-SM   : \", user['nonsm_src'].mean())\n",
    "print(\"Mean freq. of rcv COVID-19 info from SM       : \", user['sm_src'].mean())\n",
    "\n",
    "print(\"\\n** CRT **\")\n",
    "print(\"Mean score for CRT-1                          : \", user['crtone'].mean())\n",
    "print(\"Mean score for CRT-2                          : \", user['crttwo'].mean())\n",
    "print(\"Mean CRT score                                : \", user['crt_score'].mean())\n",
    "\n",
    "print(\"\\n** COVID-19 Behaviors **\")\n",
    "print(\"Mean surgical mask ownership                  : \", user['own_surgical_mask'].mean())\n",
    "print(\"Mean KN95 mask ownership                      : \", user['own_kn95_mask'].mean())\n",
    "print(\"Mean multiple mask ownership (masks owned)    : \", user['multiple_masks'].mean())\n",
    "print(\"Mean WTP for KN95 mask                        : \", user['willing_kn95_price'].mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 167,
   "metadata": {},
   "outputs": [],
   "source": [
    "# a1 = user['To what an extent do you agree with the statement?.9'].dropna()\n",
    "# a2 = user['To what an extent do you agree with the statement?.8'].dropna()\n",
    "# a3 = user['To what an extent do you agree with the statement?.7'].dropna()\n",
    "\n",
    "# b1 = user['To what an extent do you agree with the statement?'].dropna()\n",
    "# b2 = user['To what an extent do you agree with the statement?.1'].dropna()\n",
    "# b3 = user['To what an extent do you agree with the statement?.2'].dropna()\n",
    "# b4 = user['To what an extent do you agree with the statement?.3'].dropna()\n",
    "# b5 = user['To what an extent do you agree with the statement?.4'].dropna()\n",
    "# b6 = user['To what an extent do you agree with the statement?.5'].dropna()\n",
    "# b7 = user['To what an extent do you agree with the statement?.6'].dropna()\n",
    "\n",
    "# true news accuracy\n",
    "# print(((a1+a2+a3)/3).mean())\n",
    "# false news accuracy\n",
    "# print(((b1+b2+b3+b4+b5+b6+b7)/7).mean())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## <span style=\"color:blue\">Finding 1</span>\n",
    "### (a) CRT vs. Truth Discernment (Figure 1 - Left Plot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7154195010634917\n",
      "0.8048206936502063\n",
      "0.854371378132275\n"
     ]
    }
   ],
   "source": [
    "grp = user.groupby('crt_score')\n",
    "grp_mean = grp.agg({'discern':'mean'})\n",
    "\n",
    "crt_a_mean = grp.get_group(0)['discern'].mean()\n",
    "crt_b_mean = grp.get_group(0.5)['discern'].mean()\n",
    "crt_c_mean = grp.get_group(1)['discern'].mean()\n",
    "\n",
    "print(grp.get_group(0)['discern'].mean())\n",
    "print(grp.get_group(0.5)['discern'].mean())\n",
    "print(grp.get_group(1)['discern'].mean())\n",
    "\n",
    "ci_a = crt_a_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0)['discern'].count()-1, loc=np.mean(grp.get_group(0)['discern']), scale=stats.sem(grp.get_group(0)['discern']))[0]\n",
    "ci_b = crt_b_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0.5)['discern'].count()-1, loc=np.mean(grp.get_group(0.5)['discern']), scale=stats.sem(grp.get_group(0.5)['discern']))[0]\n",
    "ci_c = crt_c_mean - stats.t.interval(alpha=0.95, df=grp.get_group(1)['discern'].count()-1, loc=np.mean(grp.get_group(1)['discern']), scale=stats.sem(grp.get_group(1)['discern']))[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAD0CAYAAADOibL4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAYyklEQVR4nO3df5QdZZng8e9D+CEwMq4SBdKJQAhoZCFIB2Fmd7pxVCLOBB1ZSFjBrGJWEGV0dQ+OLjSsnmFU4ChyxIhMQIe06MgYnQAySoCjIwQk/EgQiEmAjoz8EBKRxZj47B+3Otw06e5Kp+t2dff3c06ddL313qrncu7hOfXWW88b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vQ2ZeU9m3tbcKTM3A3dQvkjwq4Hf0lg6gcx8LjPXAETEQRHxbxFxT0T8PCKmRsPnizut+yLi5KJvZ0TcFhGLgZURMaHot6y4M/ufO/xfQKqYd1DS0BwK3DVYp4h4GfAm4OyS570H+DWwJiJ+BHw3M79fHPsn4MLMvK44707A3wAzgMOBvYFlEXFr0f+NwKGZuSYi5gPrM3NmROwG/CQiftib/KQ68g5KqsbUiFhOI9k8npn3lvlQccc1CziRxkKGl0REV0S8HJiUmdcV/V7IzOeB/wIsyszNmflr4BZgZnG6O5oS0NuA04qYbgdeBUwbhu8pVcYEJQ3NCgauKv7L4pnTVODIprp6g8qGOzLz72kUj333EGP8XdPfAXw4M2cU2wGZ+cMhnldqCROUNDQ/BnYrhs4AiIjDIuK/NnfKzKeAc4BPljlpROwXEW9sapoBPJKZvwV6IuKdRb/dImIP4Dbg5OIZ00TgL2g88+rrRuCMiNil+PzBEbFnua8qjQwTlDQE2aiy/C7gLcU08xXA3wP/sY3u/wLs0Td59WMX4AsR8YtiOO5kXnx+dSqNyub3Aj8F9qExk/BeGs+ufgz878zcVgxXACuBn0fE/cBX8Rm0as5q5pKkWvIOSpJUSyYoSVItmaAkSbVkgpIk1ZIJSpJUSyYoSVItmaAkSbX0/wGoK9kcV6J9MgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x252 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def addlabels(x,y):\n",
    "    for i in range(len(x)):\n",
    "        plt.text(i+0.4, y[i]+0.06, y[i], ha = 'center')\n",
    "\n",
    "crt_a_mean = round(crt_a_mean,2)\n",
    "crt_b_mean = round(crt_b_mean,2)\n",
    "crt_c_mean = round(crt_c_mean,2)\n",
    "\n",
    "usable1 = {'crt':['0', '0.5', '1'],\n",
    "        'discern': [crt_a_mean, crt_b_mean, crt_c_mean],\n",
    "         'ci': [ci_a, ci_b, ci_c]}\n",
    " \n",
    "new_colors1 = ['red','blue','green']\n",
    "\n",
    "# The x position of bars\n",
    "barWidth = 0.4\n",
    "r1 = np.arange(len(usable1))\n",
    "r2 = [x + barWidth for x in r1]\n",
    "    \n",
    "plt.figure(figsize=(6,3.5))\n",
    "barh = plt.bar(r2, usable1['discern'], width = barWidth, yerr=usable1['ci'],color=new_colors1,alpha=0.5, align='center',capsize=5)\n",
    "\n",
    "# general layout\n",
    "plt.xticks([r + barWidth for r in range(len(usable1))], ['0', '0.5', '1'])\n",
    "plt.ylabel('height')\n",
    "\n",
    "x = usable1['crt']\n",
    "y = usable1['discern']\n",
    "addlabels(x, y)\n",
    "plt.ylim(0.0,1.0)\n",
    "\n",
    "plt.xlabel('CRT Score')\n",
    "plt.ylabel('Mean Truth Discernment')\n",
    "plt.tight_layout()\n",
    "plt.savefig('crt_discernment.png', dpi=400)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### (b) CRT vs. Perceived Accuracy of News (Figure 1 - Right Plot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.2581254724973547\n",
      "0.18077601416872446\n",
      "0.12622826914285723\n"
     ]
    }
   ],
   "source": [
    "grp = user.groupby('crt_score')\n",
    "grp_mean = grp.agg({'false_acc':'mean'})\n",
    "\n",
    "crt_a_false_mean = grp.get_group(0)['false_acc'].mean()\n",
    "crt_b_false_mean = grp.get_group(0.5)['false_acc'].mean()\n",
    "crt_c_false_mean = grp.get_group(1)['false_acc'].mean()\n",
    "\n",
    "print(grp.get_group(0)['false_acc'].mean())\n",
    "print(grp.get_group(0.5)['false_acc'].mean())\n",
    "print(grp.get_group(1)['false_acc'].mean())\n",
    "\n",
    "ci_a_false = crt_a_false_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0)['false_acc'].count()-1, loc=np.mean(grp.get_group(0)['false_acc']), scale=stats.sem(grp.get_group(0)['false_acc']))[0]\n",
    "ci_b_false = crt_b_false_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0.5)['false_acc'].count()-1, loc=np.mean(grp.get_group(0.5)['false_acc']), scale=stats.sem(grp.get_group(0.5)['false_acc']))[0]\n",
    "ci_c_false = crt_c_false_mean - stats.t.interval(alpha=0.95, df=grp.get_group(1)['false_acc'].count()-1, loc=np.mean(grp.get_group(1)['false_acc']), scale=stats.sem(grp.get_group(1)['false_acc']))[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.9735449735502645\n",
      "0.9855967078312754\n",
      "0.9805996472804231\n"
     ]
    }
   ],
   "source": [
    "grp = user.groupby('crt_score')\n",
    "grp_mean = grp.agg({'true_acc':'mean'})\n",
    "\n",
    "crt_a_true_mean = grp.get_group(0)['true_acc'].mean()\n",
    "crt_b_true_mean = grp.get_group(0.5)['true_acc'].mean()\n",
    "crt_c_true_mean = grp.get_group(1)['true_acc'].mean()\n",
    "\n",
    "print(grp.get_group(0)['true_acc'].mean())\n",
    "print(grp.get_group(0.5)['true_acc'].mean())\n",
    "print(grp.get_group(1)['true_acc'].mean())\n",
    "\n",
    "ci_a_true = crt_a_true_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0)['true_acc'].count()-1, loc=np.mean(grp.get_group(0)['true_acc']), scale=stats.sem(grp.get_group(0)['true_acc']))[0]\n",
    "ci_b_true = crt_b_true_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0.5)['true_acc'].count()-1, loc=np.mean(grp.get_group(0.5)['true_acc']), scale=stats.sem(grp.get_group(0.5)['true_acc']))[0]\n",
    "ci_c_true = crt_c_true_mean - stats.t.interval(alpha=0.95, df=grp.get_group(1)['true_acc'].count()-1, loc=np.mean(grp.get_group(1)['true_acc']), scale=stats.sem(grp.get_group(1)['true_acc']))[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "metadata": {},
   "outputs": [],
   "source": [
    "# from scipy import stats\n",
    "\n",
    "# print(stats.ttest_ind(grp.get_group(0)['false_acc'], grp.get_group(0.5)['false_acc'], equal_var=False, nan_policy='omit'))\n",
    "# print(stats.ttest_ind(grp.get_group(0)['false_acc'], grp.get_group(1)['false_acc'], equal_var=False, nan_policy='omit'))\n",
    "# print(stats.ttest_ind(grp.get_group(0.5)['false_acc'], grp.get_group(1)['false_acc'], equal_var=False, nan_policy='omit'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAD0CAYAAADOibL4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAoxElEQVR4nO3deXxU5dn/8c9l2MRYfYqomODDTtm3QLBVCCKyWFA0WtGquKF9RLRVUGsfjFQfraX6w2rFtVZbAUVRrAqiQABRZA8QKqJsoUoBQUUEQrh+f8wQJyGZHJJMMkm+79drXs455z73uSaJXHOfcy/m7oiIiMSbYyo7ABERkaIoQYmISFxSghIRkbikBCUiInFJCUpEROJSrcoO4GiddNJJ3qRJk8oOQ0REysnSpUt3uHvDwvurXIJq0qQJS5YsqewwRESknJjZpqL26xafiIjEJSUoERGJS0pQIiISl5SgREQkLilBiVRxM2bMoHXr1rRo0YIHH3zwiOObNm2ib9++dOzYkbS0NHJycvKP3XHHHbRv35727dszZcqUigxbpERKUCJVWF5eHjfddBPvvPMO2dnZTJo0iezs7AJlbr/9dq688kqysrIYO3Ysd911FwBvvfUWy5YtY8WKFSxatIjx48fzzTffVMbHECmSEpRIFfbxxx/TokULmjVrRp06dbj00kt54403CpTJzs7m7LPPBqBPnz75x7Ozs+nVqxe1atXiuOOOo2PHjsyYMaPCP4OUn7K0pseMGUO7du1o06YNo0aNIh5WulCCE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QuqQUlIiJxSQlKRETikhKUiIjEJSUoERGJS0pQIiISl5SgREQkLilBiYhIXPr/NBvfy0mMmf0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x252 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def addlabels(x,y):\n",
    "    for i in range(len(x)):\n",
    "        plt.text(i, y[i]+0.06, y[i], ha = 'center')\n",
    "\n",
    "def v2_addlabels(x,y):\n",
    "    for i in range(len(x)):\n",
    "        plt.text(i+0.3, y[i]+0.04, y[i], ha = 'center')\n",
    "        \n",
    "crt_a_false_mean = round(crt_a_false_mean,2)\n",
    "crt_b_false_mean = round(crt_b_false_mean,2)\n",
    "crt_c_false_mean = round(crt_c_false_mean,2)\n",
    "crt_a_true_mean = round(crt_a_true_mean,2)\n",
    "crt_b_true_mean = round(crt_b_true_mean,2)\n",
    "crt_c_true_mean = round(crt_c_true_mean,2)\n",
    "\n",
    "usable1 = {'crt':['0', '0.5', '1'],\n",
    "        'false_acc': [crt_a_false_mean, crt_b_false_mean, crt_c_false_mean],\n",
    "         'ci': [ci_a_false, ci_b_false, ci_c_false]}\n",
    "\n",
    "usable2 = {'crt':['0', '0.5', '1'],\n",
    "        'true_acc': [crt_a_true_mean, crt_b_true_mean, crt_c_true_mean],\n",
    "         'ci': [ci_a_true, ci_b_true, ci_c_true]}\n",
    "\n",
    "new_colors1 = ['green','green','green']\n",
    "new_colors2 = ['black','black','black']\n",
    "\n",
    "# The x position of bars\n",
    "barWidth = 0.3\n",
    "r1 = np.arange(len(usable1))\n",
    "r2 = [x + barWidth for x in r1]\n",
    "    \n",
    "plt.figure(figsize=(6,3.5))\n",
    "plt.bar(r1, usable1['false_acc'], width = barWidth, yerr=usable1['ci'],color=new_colors1,alpha=0.5, align='center',capsize=5,label='False News')\n",
    "plt.bar(r2, usable2['true_acc'], width = barWidth, yerr=usable2['ci'],color=new_colors2,alpha=0.5, align='center',capsize=5,label='True News')\n",
    "\n",
    "x = usable1['crt']\n",
    "y = usable1['false_acc']\n",
    "addlabels(x, y)\n",
    "plt.ylim(0.0,1.1)\n",
    "\n",
    "x2 = usable2['crt']\n",
    "y2 = usable2['true_acc']\n",
    "v2_addlabels(x2, y2)\n",
    "\n",
    "# general layout\n",
    "plt.xticks([r + barWidth for r in range(len(usable1))], ['0', '0.5', '1'])\n",
    "plt.ylabel('height')\n",
    "\n",
    "plt.xlabel('CRT Score')\n",
    "plt.ylabel('Mean Accuracy of COVID-19 News')\n",
    "plt.legend(loc='center right')\n",
    "plt.tight_layout()\n",
    "plt.savefig('crt_accuracy.png', dpi=400)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## <span style=\"color:blue\">Finding 2</span>\n",
    "### (a) CRT vs. Trust in Formal, Non-Social Media Sources (Figure 2 - Left Plot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 174,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "           trust_nonsm\n",
      "crt_score             \n",
      "0.0           3.050745\n",
      "0.5           2.762794\n",
      "1.0           2.706522\n"
     ]
    }
   ],
   "source": [
    "grp = user.groupby('crt_score')\n",
    "grp_mean = grp.agg({'trust_nonsm':'mean'})\n",
    "print(grp_mean)\n",
    "\n",
    "crt_a_mean = grp.get_group(0)['trust_nonsm'].mean()\n",
    "crt_b_mean = grp.get_group(0.5)['trust_nonsm'].mean()\n",
    "crt_c_mean = grp.get_group(1)['trust_nonsm'].mean()\n",
    "\n",
    "ci_a = crt_a_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0)['trust_nonsm'].count()-1, loc=np.nanmean(grp.get_group(0)['trust_nonsm']), scale=stats.sem(grp.get_group(0)['trust_nonsm'], nan_policy='omit'))[0]\n",
    "ci_b = crt_b_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0.5)['trust_nonsm'].count()-1, loc=np.nanmean(grp.get_group(0.5)['trust_nonsm']), scale=stats.sem(grp.get_group(0.5)['trust_nonsm'], nan_policy='omit'))[0]\n",
    "ci_c = crt_c_mean - stats.t.interval(alpha=0.95, df=grp.get_group(1)['trust_nonsm'].count()-1, loc=np.nanmean(grp.get_group(1)['trust_nonsm']), scale=stats.sem(grp.get_group(1)['trust_nonsm'], nan_policy='omit'))[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAD0CAYAAADOibL4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAeXklEQVR4nO3deZRV5Znv8e8PBFRQnLAlgBrROEZLKMUEW8C0aUwMJkKLOAQiXoKJkXRy7Zj0vVjY98akjTgEbwwdBzQ2mOuQIG20aZRB4wRYKEM0BFHgEi0hMgQZ89w/zgYPRdWpTVH71Kk6v89ae3H2u9+z91Oss9az3r3f/byKCMzMzEpNm+YOwMzMrC5OUGZmVpKcoMzMrCQ5QZmZWUlygjIzs5LkBGVmZiUpswQlaX9Jr0haIGmRpHF19BkhqUZSdbJdk1U8ZmbWsuyX4bm3AOdHxEZJ7YDnJf02Il6q1e+RiLguwzjMzKwFyixBRe4N4I3Jbrtk81vBZmaWSpYjKCS1BeYBxwN3R8TLdXQbLOk84C3gHyNiRR3nGQWMAujYsWPvk046KcOozcysmObNm/dBRHSp3a5ilDqSdAjwBPCtiFiY1344sDEitkj6OjA0Is4vdK7KysqYO3dupvGamVnxSJoXEZW124syiy8iPgSeAwbWal8TEVuS3V8AvYsRj5mZlb4sZ/F1SUZOSDoAuAD4fa0+XfN2BwFLsorHzMxaliyfQXUFJiXPodoAv4qIaZJuBuZGxFTgekmDgO3AWmBEhvGYmVkLUpRnUE3Jz6DMzFqXZn0GZWZmtrcaTFCS/l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1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def addlabels(x,y):\n",
    "    for i in range(len(x)):\n",
    "        plt.text(i+0.4, y[i]+0.2, y[i], ha = 'center')\n",
    "\n",
    "# initialise data of lists.\n",
    "crt_a_mean = round(crt_a_mean,2)\n",
    "crt_b_mean = round(crt_b_mean,2)\n",
    "crt_c_mean = round(crt_c_mean,2)\n",
    "\n",
    "usable1 = {'crt':['0', '0.5', '1'],\n",
    "        'trust': [crt_a_mean, crt_b_mean, crt_c_mean],\n",
    "         'ci': [ci_a, ci_b, ci_c]}\n",
    " \n",
    "new_colors1 = ['red','blue','green']\n",
    "\n",
    "# The x position of bars\n",
    "barWidth = 0.4\n",
    "r1 = np.arange(len(usable1))\n",
    "r2 = [x + barWidth for x in r1]\n",
    "    \n",
    "plt.figure(figsize=(6,3.5))\n",
    "plt.bar(r2, usable1['trust'], width = barWidth, yerr=usable1['ci'],color=new_colors1,alpha=0.5, align='center',capsize=5)\n",
    "\n",
    "# general layout\n",
    "plt.xticks([r + barWidth for r in range(len(usable1))], ['0', '0.5', '1'])\n",
    "plt.ylabel('height')\n",
    "\n",
    "x = usable1['crt']\n",
    "y = usable1['trust']\n",
    "addlabels(x, y)\n",
    "plt.ylim(0.0,3.5)\n",
    "\n",
    "plt.xlabel('CRT Score')\n",
    "plt.ylabel('Mean Trust Ratings of Formal Sources')\n",
    "plt.tight_layout()\n",
    "plt.savefig('crt_trust_formal.png', dpi=400)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### (b) CRT vs. Trust in Social Media Platforms (Figure 2 - Right Plot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 176,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              trust\n",
      "crt_score          \n",
      "0.0        2.727151\n",
      "0.5        2.755854\n",
      "1.0        2.850529\n"
     ]
    }
   ],
   "source": [
    "grp = user.groupby('crt_score')\n",
    "grp_mean = grp.agg({'trust':'mean'})\n",
    "print(grp_mean)\n",
    "\n",
    "crt_a_mean = grp.get_group(0)['trust'].mean()\n",
    "crt_b_mean = grp.get_group(0.5)['trust'].mean()\n",
    "crt_c_mean = grp.get_group(1)['trust'].mean()\n",
    "\n",
    "# print(grp.get_group(0)['discern'].mean())\n",
    "# print(grp.get_group(0.5)['discern'].mean())\n",
    "# print(grp.get_group(1)['discern'].mean())\n",
    "\n",
    "ci_a = crt_a_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0)['trust'].count()-1, loc=np.nanmean(grp.get_group(0)['trust']), scale=stats.sem(grp.get_group(0)['trust'], nan_policy='omit'))[0]\n",
    "ci_b = crt_b_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0.5)['trust'].count()-1, loc=np.nanmean(grp.get_group(0.5)['trust']), scale=stats.sem(grp.get_group(0.5)['trust'], nan_policy='omit'))[0]\n",
    "ci_c = crt_c_mean - stats.t.interval(alpha=0.95, df=grp.get_group(1)['trust'].count()-1, loc=np.nanmean(grp.get_group(1)['trust']), scale=stats.sem(grp.get_group(1)['trust'], nan_policy='omit'))[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 177,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAD8CAYAAAAi2jCVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAf/UlEQVR4nO3deZgV9Z3v8fcHBBfQiIoDsiigURBiB3CLC+AdE41RE2CiXjcSHYxXlGjGGc1cpfHOjXHLxG2iXOPuoJm4DOQxGKMBdyO7LJIoakARcWETZf3eP6oaD033OdVNn9OHPp/X89TTp6p+VfVtnvPw7arft34/RQRmZmblplVzB2BmZlYXJygzMytLTlBmZlaWnKD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uXLkQzs8q2aNEihgwZQp8+fTj44IO5+eabt2qzYsUKTj75ZA455BAOPvhg7rnnns37WrduTVVVFVVVVZxyyvbz8CvLaObTI6J/oW2l4tHMzazSLFmyhCVLltC/f39WrVrFgAEDeOKJJ+jTp8/mNj/72c9YsWIF1113HcuWLePAAw/kgw8+oG3btrRv357Vq1c342+QX32jmeer4jsR+DbQRdItObt2I5m/yczMSqBz58507twZgF133ZXevXvz3nvvbZGgJLFq1SoigtWrV7PHHnuwww5Z3iQqX/mq+N4HpgJfANNylgnAt4ofmpmZ1fbOO+8wY8YMDj/88C22jxo1ivnz57PPPvvQr18/br75Zlq1Sv6L/+KLLxg4cCBHHHEETzzxRDNE3Tj1pteImAXMkvSfHhjWzKz5rV69mmHDhvHLX/6S3XbbbYt9Tz31FFVVVTz77LO89dZbHH/88RxzzDHstttuvPvuu3Tp0oWFCxdy3HHH0a9fP3r16lXPVcpHlqGO9pP0W0nzJC2sWYoemVkLlKWz+4Ybbtjcod23b19at27NJ598AsDy5csZPnw4Bx10EL179+bll18u9a9gzWT9+vUMGzaMM888k6FDh261/5577mHo0KFIYv/996dHjx688cYbAHTp0gWAnj17MnjwYGbMmFHS2BsrS4K6h2T08g3AEOB+4MFiBmXWUu2www7cdNNNzJs3j1deeYXbb7+defPmbdHm8ssvZ+bMmcycOZNrr72WQYMGscceySTWo0eP5oQTTuCNN95g1qxZ9O7duzl+DSuxiOC8886jd+/eXHbZZXW26d69O8888wwAS5cuZcGCBfTs2ZNPP/2UtWuT8RU++ugjXnzxxS36rspZlh60nSPiGUmKiHeBaknTgKvzHSRpJ+A5YMf0Or+NiDG12uxIkvAGAB8Dp0XEOw3/NZrHokWLOOecc1i6dCmSGDlyJKNHj96izQ033MBDDz0EwIYNG5g/fz7Lli1jl1124dhjj2Xt2rVs2LCB4cOHM3bs2Ob4NayEsnR25xo/fjxnnHEGkJQRP/fcc9x7770AtG3blrZt25YkbmteL774Ig888AD9+vWjqqoKSKr2/va3vwHwox/9iKuuu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YhwS6RNFfSLOASYETzRGvlStJ44GXgQEmLJZ3X3DE1BQ91ZGZmZcl3UGZmVpacoMzMrCw5QZmZWVlygjIzs7LkBGVmZmXJCcqskSR1kvSwpLckTZP0pKSvStpP0ufpyOPzJN0v6e9yRiP/QNJ7Oetta533h5JelzRb0hxJHpvPKlK++aDMrB6SRDJw8n0RcXq67RDg70jG1nsrIqrS0cqfBv4+IqrSdtXA6oi4sY7zdgX+FegfESsktQc6bmOsO6TvW5ltV3wHZdY4Q4D1EXFHzYaImBURz+c2ioiNwJ9JBoXNYm9gFcnUCUTE6oh4G0DS/pL+KGmWpOmSeilxQ3qn9bqk09K2gyU9n86MPU9S67Tda+md2QXb/C9gVmS+gzJrnL7AtEKNJO1EMjr56IznnQUsBd6W9AzwWERMTPc9BPw8Ih5Pz9sKGApUAYcAewGvSXoubd8f6BsRb0saCayIiEPT+d1elPSHmuRnVo58B2VWHL0kzSRJNksiYnaWg9I7rhOA4SRTa/y7pGpJuwJdIuLxtN0XEbEGOBoYHxEbI2IpMAU4ND3dn3MS0DeBc9KYXgX2JJmtwKxsOUGZNc5cYECe/W+lfU69gAE54+oVFIk/R8S1JIPHDmtkjJ/lfBZwcURUpUuPiPhDI89rVhJOUGaN8yywY/roDABJX5N0TG6jiPgIuAK4MstJJe0jqX/Opirg3YhYBSyW9N203Y6SdgGeB05L+5g6AseS9HnV9hRwoaQ26fFfldQu269q1jycoMwaIZJRlr8H/H1aZj4XuBb4oI7mTwC71E5e9WgD3CjpjfRx3Gl82X91NsnI5rOBl4BOJJWEs0n6rp4F/jki6orhLmAeMF3SHOBO3AdtZc6jmZuZWVnyHZSZmZUlJygzMytLTlBmZlaWnKDMzKwsOUGZmVlZcoIyM7Oy5ARlZmZlyQnKzMzK0v8H4eyGKHL1vfAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x252 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def addlabels(x,y):\n",
    "    for i in range(len(x)):\n",
    "        plt.text(i+0.4, y[i]+0.2, y[i], ha = 'center')\n",
    "\n",
    "# initialise data of lists.\n",
    "crt_a_mean = round(crt_a_mean,2)\n",
    "crt_b_mean = round(crt_b_mean,2)\n",
    "crt_c_mean = round(crt_c_mean,2)\n",
    "\n",
    "usable1 = {'crt':['0', '0.5', '1'],\n",
    "        'trust': [crt_a_mean, crt_b_mean, crt_c_mean],\n",
    "         'ci': [ci_a, ci_b, ci_c]}\n",
    " \n",
    "new_colors1 = ['red','blue','green']\n",
    "\n",
    "# The x position of bars\n",
    "barWidth = 0.4\n",
    "r1 = np.arange(len(usable1))\n",
    "r2 = [x + barWidth for x in r1]\n",
    "    \n",
    "plt.figure(figsize=(6,3.5))\n",
    "plt.bar(r2, usable1['trust'], width = barWidth, yerr=usable1['ci'],color=new_colors1,alpha=0.5, align='center',capsize=5)\n",
    "\n",
    "# general layout\n",
    "plt.xticks([r + barWidth for r in range(len(usable1))], ['0', '0.5', '1'])\n",
    "plt.ylabel('height')\n",
    "\n",
    "x = usable1['crt']\n",
    "y = usable1['trust']\n",
    "addlabels(x, y)\n",
    "plt.ylim(0.0,3.5)\n",
    "\n",
    "plt.xlabel('CRT Score')\n",
    "plt.ylabel('Mean Trust Rating of Social Media Platforms')\n",
    "plt.tight_layout()\n",
    "plt.savefig('crt_trust.png', dpi=400)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 178,
   "metadata": {},
   "outputs": [],
   "source": [
    "# from scipy import stats\n",
    "\n",
    "# print(stats.ttest_ind(grp.get_group(0)['trust'], grp.get_group(0.5)['trust'], equal_var=False, nan_policy='omit'))\n",
    "# print(stats.ttest_ind(grp.get_group(0)['trust'], grp.get_group(1)['trust'], equal_var=False, nan_policy='omit'))\n",
    "# print(stats.ttest_ind(grp.get_group(0.5)['trust'], grp.get_group(1)['trust'], equal_var=False, nan_policy='omit'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## <span style=\"color:blue\">Finding 3</span>\n",
    "### (a) CRT vs. Willingness to Pay (Figure 3 - Left Plot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 179,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "           willing_kn95_price\n",
      "crt_score                    \n",
      "0.0                 90.185185\n",
      "0.5                 90.679012\n",
      "1.0                111.931217\n"
     ]
    }
   ],
   "source": [
    "grp = user.groupby('crt_score')\n",
    "grp_mean = grp.agg({'willing_kn95_price':'mean'})\n",
    "print(grp_mean)\n",
    "\n",
    "crt_a_mean = grp.get_group(0)['willing_kn95_price'].mean()\n",
    "crt_b_mean = grp.get_group(0.5)['willing_kn95_price'].mean()\n",
    "crt_c_mean = grp.get_group(1)['willing_kn95_price'].mean()\n",
    "\n",
    "ci_a = crt_a_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0)['willing_kn95_price'].count()-1, loc=np.mean(grp.get_group(0)['willing_kn95_price']), scale=stats.sem(grp.get_group(0)['willing_kn95_price']))[0]\n",
    "ci_b = crt_b_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0.5)['willing_kn95_price'].count()-1, loc=np.mean(grp.get_group(0.5)['willing_kn95_price']), scale=stats.sem(grp.get_group(0.5)['willing_kn95_price']))[0]\n",
    "ci_c = crt_c_mean - stats.t.interval(alpha=0.95, df=grp.get_group(1)['willing_kn95_price'].count()-1, loc=np.mean(grp.get_group(1)['willing_kn95_price']), scale=stats.sem(grp.get_group(1)['willing_kn95_price']))[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 180,
   "metadata": {},
   "outputs": [],
   "source": [
    "# from scipy import stats\n",
    "\n",
    "# print(stats.ttest_ind(grp.get_group(0)['willing_kn95_price'], grp.get_group(0.5)['willing_kn95_price'], equal_var=False, nan_policy='omit'))\n",
    "# print(stats.ttest_ind(grp.get_group(0)['willing_kn95_price'], grp.get_group(1)['willing_kn95_price'], equal_var=False, nan_policy='omit'))\n",
    "# print(stats.ttest_ind(grp.get_group(0.5)['willing_kn95_price'], grp.get_group(1)['willing_kn95_price'], equal_var=False, nan_policy='omit'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 181,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAD0CAYAAADOibL4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAbtklEQVR4nO3de7xVdZ3/8debiyKo4QUQQcTsIMLJGD2pTCaHCMVUkHRIS8RbTDOZTTopjvMYj7+0cDS7zK8yAgMbg9AwHLMSTcAxlcBAEG/kDQiB8AKlptRn/lgL3MA5m805Z+29Dvv9fDz24+z1XZfvZ/vY7g/f7/qu71cRgZmZWd60q3QAZmZmjXGCMjOzXHKCMjOzXHKCMjOzXHKCMjOzXHKCMjOzXMosQUm6VdI6Scsa2Xe5pJB0YLotSd+WtELSE5KOziouMzNrG7JsQU0FRmxfKOkQ4CTg5YLiU4Ca9DUe+F6GcZmZWRuQWYKKiPnAq43s+gZwBVD4hPAo4LZIPAp0ldQzq9jMzCz/OpSzMkmjgNURsURS4a5ewMqC7VVp2ZpGrjGepJVFly5djunfv392AZuZWeYWLVr0x4jotn152RKUpM7Av5F07zVbREwCJgHU1dXFwoULWyE6MzOrFEkvNVZezhbU4cBhwJbWU2/gcUnHAquBQwqO7Z2WmZlZlSrbMPOIWBoR3SOib0T0JenGOzoiXgHuBs5LR/MdD7wRETt075mZWfXIcpj5dOAR4AhJqyRdVOTwe4HngRXAD4B/ziouMzNrGzLr4ouIc3ayv2/B+wA+n1UsZmbW9ngmCTMzyyUnKDMzyyUnKDMzyyUnKDOzHLrwwgvp3r07tbW1W8vuuOMOBg4cSLt27Sh8BnTDhg0MHTqUvffem0suuaTJay5ZsoTBgwfzwQ9+kNNPP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aWS05QZmaWS05QZmaWS05QZmaWS05QZmaWS/8HO6qFRXqD6r4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x252 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def addlabels(x,y):\n",
    "    for i in range(len(x)):\n",
    "        plt.text(i+0.4, y[i]+17, y[i], ha = 'center')\n",
    "\n",
    "# initialise data of lists\n",
    "crt_a_mean = round(crt_a_mean,1)\n",
    "crt_b_mean = round(crt_b_mean,1)\n",
    "crt_c_mean = round(crt_c_mean,1)\n",
    "\n",
    "usable1 = {'crt':['0', '0.5', '1'],\n",
    "        'willing_kn95_price': [crt_a_mean, crt_b_mean, crt_c_mean],\n",
    "         'ci': [ci_a, ci_b, ci_c]}\n",
    " \n",
    "new_colors1 = ['red','blue','green']\n",
    "\n",
    "# The x position of bars\n",
    "barWidth = 0.4\n",
    "r1 = np.arange(len(usable1))\n",
    "r2 = [x + barWidth for x in r1]\n",
    "    \n",
    "plt.figure(figsize=(6,3.5))\n",
    "plt.bar(r2, usable1['willing_kn95_price'], width = barWidth, yerr=usable1['ci'],color=new_colors1,alpha=0.5, align='center',capsize=5)\n",
    "\n",
    "# general layout\n",
    "plt.xticks([r + barWidth for r in range(len(usable1))], ['0', '0.5', '1'])\n",
    "plt.ylabel('height')\n",
    "\n",
    "x = usable1['crt']\n",
    "y = usable1['willing_kn95_price']\n",
    "addlabels(x, y)\n",
    "plt.ylim(0.0,140)\n",
    "\n",
    "plt.xlabel('CRT Score')\n",
    "plt.ylabel('Willingness to Pay (PKR)')\n",
    "plt.tight_layout()\n",
    "plt.savefig('crt_wtp.png', dpi=400)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### (b) CRT vs. Masks Won Plot (Figure 3 - Right Plot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 183,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "           won_mask\n",
      "crt_score          \n",
      "0.0        0.312169\n",
      "0.5        0.333333\n",
      "1.0        0.439153\n"
     ]
    }
   ],
   "source": [
    "grp = user.groupby('crt_score')\n",
    "grp_mean = grp.agg({'won_mask':'mean'})\n",
    "print(grp_mean)\n",
    "\n",
    "crt_a_mean = grp.get_group(0)['won_mask'].mean()\n",
    "crt_b_mean = grp.get_group(0.5)['won_mask'].mean()\n",
    "crt_c_mean = grp.get_group(1)['won_mask'].mean()\n",
    "\n",
    "ci_a = crt_a_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0)['won_mask'].count()-1, loc=np.mean(grp.get_group(0)['won_mask']), scale=stats.sem(grp.get_group(0)['won_mask']))[0]\n",
    "ci_b = crt_b_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0.5)['won_mask'].count()-1, loc=np.mean(grp.get_group(0.5)['won_mask']), scale=stats.sem(grp.get_group(0.5)['won_mask']))[0]\n",
    "ci_c = crt_c_mean - stats.t.interval(alpha=0.95, df=grp.get_group(1)['won_mask'].count()-1, loc=np.mean(grp.get_group(1)['won_mask']), scale=stats.sem(grp.get_group(1)['won_mask']))[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 184,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAD0CAYAAADOibL4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAZnklEQVR4nO3df5RV5X3v8fdHEKmO2vRKmzhDAgpawchcHaRJ/DHmxoiajDVaM7pMJCaXJguqDW3VNA0O3PSKjaXXFqwaqxJToYlGGCPij5gxmtwC428YtSA/ZGhsUJugViWM3/5x9kzODMyZDcw+s2fO57XWWZzn2c/s8z1Zx3zXs5/vfrYiAjMzs7zZb6ADMDMz2x0nKDMzy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EljJY0AGoGSz5gyMzPrlFmCioidwEzgAeB54HsRsVbSXEkNAJImS2oH/gi4SZIf5WFmZkC2VXxExHIKm80W980uer+awqU/MzOzbgZFkYSZmVUeJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8slJygzM8ulTBOUpKmSXpS0XtJVuzl+gKR/SY6vlDQmy3jMzGzwyCxBSRoGLATOBCYAF0qa0GPYF4H/jIhxwN8B12YVj5mZDS5ZzqBOBNZHxIaI2AEsAc7pMeYcYFHy/i7gf0lShjGZmdkgoYjI5sTS+cDUiPhS0v4cMCUiZhaNWZOMaU/aLyVjXu1xrunA9KR5NPBiJkFn5zDg1T5HmXXn343tqcH6m/lQRIzq2Tl8ICLZUxFxM3DzQMextyS1RkTdQMdhg4t/N7anhtpvJstLfFuB0UXtmqRvt2MkDQcOBV7LMCYzMxskskxQq4HxksZKGgE0As09xjQDlyTvzwceiayuOZqZ2aCS2SW+iNgpaSbwADAMuDUi1kqaC7RGRDPwT8AdktYDr1NIYkPRoL08aQPKvxvbU0PqN5NZkYSZmdm+8E4SZmaWS05QZmaWS05QGetruyezFFuCTZO0TdLTyetLAxGn5ZekWyX9Irm3dMjwGlSGku2e/g04HWinUNl4YUS0DWhglhtpfiOSpgF1xTe5mxWTdArwJvCdiDh2oOPpL55BZSvNdk9W2fwbsX0WET+hUAk9pDhBZasa2FLUbk/6zDql/Y2cJ+lZSXdJGr2b42ZDjhOUWf7dC4yJiOOAh/jNBstmQ5oTVLbSbPdkla3P30hEvBYR7ybNW4ATyhSb2YBygspWmu2erLL1+RuR9IGiZgPwfBnjMxswTlAZioidQOd2T88D34uItQMbleVJb78RSXMlNSTDLpO0VtIzwGXAtIGJ1vJK0mLg/wNHS2qX9MWBjqk/uMzczMxyyTMoMzPLJScoMzPLJScoMzPLJScoMzPLJScoMzPLJScos70k6f2Slkh6SdITkpZLOkrSGElvJzuPt0n6jqTfK9qN/BVJW4vaI3qc91JJzyVbG62R5L35rCJl9sh3s6FMkoB7gEUR0Zj0TQJ+j8Leei9FRG2yW/lDwCciojYZ1wS8GRHX7ea8NcDXgeMj4leSqoBR+xjr8OR+K7NBxTMos71zGvDriLixsyMinomIx4oHRUQHsIr0mwT/LvAGhUcnEBFvRsRGAEnjJD0s6RlJT0o6UgXfSmZaz0n6bDK2XtJjkpqBNknDknGrk5nZH+/z/wJmGfMMymzvHAs80dcgSSOBKcDlKc/7DPAfwEZJPwJ+EBH3Jsf+GZgXEfck590P+AxQC0wCDgNWS/pJMv544NiI2ChpOvCriJgs6QDgp5Ie7Ex+ZnnkGZRZNo6U9DSFZPPziHg2zR8lM66pwPkUHmT4d5KaJB0MVEfEPcm4dyLiv4CTgMUR0RER/wE8CkxOTreqKAF9Evh8EtNK4H8A4/vhe5plxgnKbO+spfSu4i8la05HAicU7avXpyhYFRHXUNg89ry9jPGtovcC/iQiapPX2Ih4cC/Pa1YWTlBme+cR4IDk0hkAko6TdHLxoIh4FbgK+Fqak0o6XNLxRV21wOaIeANol/SHybgDJB0IPAZ8NlljGgWcQmHNq6cHgK9I2j/5+6MkHZTuq5oNDCcos70QhV2WzwU+kZSZrwWuAV7ZzfClwIE9k1cv9geuk/RCcjnus/xm/epzFHY2fxb4GfB+CpWEz1JYu3oEuCIidhfDLUAb8KSkNcBNeA3acs67mZuZWS55BmVmZrnkBGVmZrnkBGVmZrnkBGVmZrnkBGVmZrnkBGVmZrnkBGVmZrn03wRn6ZomGe4UAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x252 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def addlabels(x,y):\n",
    "    for i in range(len(x)):\n",
    "        plt.text(i+0.4, y[i]+0.08, y[i], ha = 'center')\n",
    "\n",
    "# initialise data of lists.\n",
    "crt_a_mean = round(crt_a_mean,2)\n",
    "crt_b_mean = round(crt_b_mean,2)\n",
    "crt_c_mean = round(crt_c_mean,2)\n",
    "\n",
    "usable1 = {'crt':['0', '0.5', '1'],\n",
    "        'won_mask': [crt_a_mean, crt_b_mean, crt_c_mean],\n",
    "         'ci': [ci_a, ci_b, ci_c]}\n",
    " \n",
    "new_colors1 = ['red','blue','green']\n",
    "\n",
    "# The x position of bars\n",
    "barWidth = 0.4\n",
    "r1 = np.arange(len(usable1))\n",
    "r2 = [x + barWidth for x in r1]\n",
    "    \n",
    "plt.figure(figsize=(6,3.5))\n",
    "plt.bar(r2, usable1['won_mask'], width = barWidth, yerr=usable1['ci'],color=new_colors1,alpha=0.5, align='center',capsize=5)\n",
    "\n",
    "# general layout\n",
    "plt.xticks([r + barWidth for r in range(len(usable1))], ['0', '0.5', '1'])\n",
    "plt.ylabel('height')\n",
    "\n",
    "x = usable1['crt']\n",
    "y = usable1['won_mask']\n",
    "addlabels(x, y)\n",
    "plt.ylim(0.0, 0.55)\n",
    "\n",
    "plt.xlabel('CRT Score')\n",
    "plt.ylabel('Mask Won (Proportion)')\n",
    "plt.tight_layout()\n",
    "plt.savefig('crt_mask_won.png', dpi=400)\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {},
   "outputs": [],
   "source": [
    "# from scipy import stats\n",
    "\n",
    "# print(stats.ttest_ind(grp.get_group(0)['won_mask'], grp.get_group(0.5)['won_mask'], equal_var=False, nan_policy='omit'))\n",
    "# print(stats.ttest_ind(grp.get_group(0)['won_mask'], grp.get_group(1)['won_mask'], equal_var=False, nan_policy='omit'))\n",
    "# print(stats.ttest_ind(grp.get_group(0.5)['won_mask'], grp.get_group(1)['won_mask'], equal_var=False, nan_policy='omit'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "**(1) Truth Discernment vs CRT\n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:                discern   R-squared:                       0.053\n",
      "Model:                            OLS   Adj. R-squared:                  0.051\n",
      "Method:                 Least Squares   F-statistic:                     34.44\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):           7.16e-09\n",
      "Time:                        14:25:25   Log-Likelihood:                 32.070\n",
      "No. Observations:                 621   AIC:                            -60.14\n",
      "Df Residuals:                     619   BIC:                            -51.28\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.7232      0.015     48.166      0.000       0.694       0.753\n",
      "crt_score      0.1390      0.024      5.869      0.000       0.092       0.185\n",
      "==============================================================================\n",
      "Omnibus:                      112.766   Durbin-Watson:                   1.919\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):              177.613\n",
      "Skew:                          -1.175   Prob(JB):                     2.70e-39\n",
      "Kurtosis:                       4.159   Cond. No.                         3.29\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "**(2) Accuracy of False News vs CRT\n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:              false_acc   R-squared:                       0.062\n",
      "Model:                            OLS   Adj. R-squared:                  0.061\n",
      "Method:                 Least Squares   F-statistic:                     41.05\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):           2.94e-10\n",
      "Time:                        14:25:25   Log-Likelihood:                 118.93\n",
      "No. Observations:                 621   AIC:                            -233.9\n",
      "Df Residuals:                     619   BIC:                            -225.0\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.2537      0.013     19.430      0.000       0.228       0.279\n",
      "crt_score     -0.1319      0.021     -6.407      0.000      -0.172      -0.091\n",
      "==============================================================================\n",
      "Omnibus:                       76.543   Durbin-Watson:                   1.935\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):              102.354\n",
      "Skew:                           0.968   Prob(JB):                     5.94e-23\n",
      "Kurtosis:                       3.457   Cond. No.                         3.29\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "**(3) Accuracy of True News vs CRT\n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:               true_acc   R-squared:                       0.001\n",
      "Model:                            OLS   Adj. R-squared:                 -0.001\n",
      "Method:                 Least Squares   F-statistic:                    0.5627\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):              0.453\n",
      "Time:                        14:25:25   Log-Likelihood:                 605.44\n",
      "No. Observations:                 621   AIC:                            -1207.\n",
      "Df Residuals:                     619   BIC:                            -1198.\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.9769      0.006    163.795      0.000       0.965       0.989\n",
      "crt_score      0.0071      0.009      0.750      0.453      -0.011       0.026\n",
      "==============================================================================\n",
      "Omnibus:                      705.732   Durbin-Watson:                   1.960\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):            38854.189\n",
      "Skew:                          -5.561   Prob(JB):                         0.00\n",
      "Kurtosis:                      40.120   Cond. No.                         3.29\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "**(4) Trust Ratings of Formal Sources vs CRT\n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:            trust_nonsm   R-squared:                       0.027\n",
      "Model:                            OLS   Adj. R-squared:                  0.025\n",
      "Method:                 Least Squares   F-statistic:                     16.60\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):           5.25e-05\n",
      "Time:                        14:25:25   Log-Likelihood:                -722.71\n",
      "No. Observations:                 604   AIC:                             1449.\n",
      "Df Residuals:                     602   BIC:                             1458.\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      3.0039      0.054     56.111      0.000       2.899       3.109\n",
      "crt_score     -0.3429      0.084     -4.074      0.000      -0.508      -0.178\n",
      "==============================================================================\n",
      "Omnibus:                       33.131   Durbin-Watson:                   1.905\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):               15.722\n",
      "Skew:                          -0.184   Prob(JB):                     0.000385\n",
      "Kurtosis:                       2.300   Cond. No.                         3.32\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "**(5) Trust Ratings of Social Media Platforms vs CRT\n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:                  trust   R-squared:                       0.005\n",
      "Model:                            OLS   Adj. R-squared:                  0.004\n",
      "Method:                 Least Squares   F-statistic:                     3.366\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):             0.0670\n",
      "Time:                        14:25:25   Log-Likelihood:                -610.76\n",
      "No. Observations:                 617   AIC:                             1226.\n",
      "Df Residuals:                     615   BIC:                             1234.\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      2.7141      0.043     63.364      0.000       2.630       2.798\n",
      "crt_score      0.1236      0.067      1.835      0.067      -0.009       0.256\n",
      "==============================================================================\n",
      "Omnibus:                       13.860   Durbin-Watson:                   1.953\n",
      "Prob(Omnibus):                  0.001   Jarque-Bera (JB):                8.359\n",
      "Skew:                           0.110   Prob(JB):                       0.0153\n",
      "Kurtosis:                       2.474   Cond. No.                         3.30\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "**(6) Willingness to Pay for KN95 Masks vs CRT\n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:     willing_kn95_price   R-squared:                       0.010\n",
      "Model:                            OLS   Adj. R-squared:                  0.008\n",
      "Method:                 Least Squares   F-statistic:                     6.241\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):             0.0127\n",
      "Time:                        14:25:25   Log-Likelihood:                -3636.3\n",
      "No. Observations:                 621   AIC:                             7277.\n",
      "Df Residuals:                     619   BIC:                             7285.\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept     86.1238      5.520     15.602      0.000      75.283      96.964\n",
      "crt_score     21.7460      8.705      2.498      0.013       4.652      38.840\n",
      "==============================================================================\n",
      "Omnibus:                      668.209   Durbin-Watson:                   1.925\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):               57.902\n",
      "Skew:                           0.407   Prob(JB):                     2.67e-13\n",
      "Kurtosis:                       1.746   Cond. No.                         3.29\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "**(7) Masks Won vs CRT\n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:               won_mask   R-squared:                       0.011\n",
      "Model:                            OLS   Adj. R-squared:                  0.009\n",
      "Method:                 Least Squares   F-statistic:                     6.671\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):             0.0100\n",
      "Time:                        14:25:25   Log-Likelihood:                -421.70\n",
      "No. Observations:                 621   AIC:                             847.4\n",
      "Df Residuals:                     619   BIC:                             856.3\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.2956      0.031      9.481      0.000       0.234       0.357\n",
      "crt_score      0.1270      0.049      2.583      0.010       0.030       0.224\n",
      "==============================================================================\n",
      "Omnibus:                     3695.660   Durbin-Watson:                   2.099\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):              102.456\n",
      "Skew:                           0.579   Prob(JB):                     5.65e-23\n",
      "Kurtosis:                       1.382   Cond. No.                         3.29\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n"
     ]
    }
   ],
   "source": [
    "# OLS results without controls (mentioned in-text)\n",
    "# truth discernment vs CRT after controlling for age, gender, education, and household expenditure (proxy for income)\n",
    "\n",
    "print(\"**(1) Truth Discernment vs CRT\\n\")\n",
    "formula = 'discern ~ crt_score'\n",
    "model = smf.ols(formula, data=user)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\\n**(2) Accuracy of False News vs CRT\\n\")\n",
    "formula = 'false_acc ~ crt_score'\n",
    "model = smf.ols(formula, data=user)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\\n**(3) Accuracy of True News vs CRT\\n\")\n",
    "formula = 'true_acc ~ crt_score'\n",
    "model = smf.ols(formula, data=user)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\\n**(4) Trust Ratings of Formal Sources vs CRT\\n\")\n",
    "formula = 'trust_nonsm ~ crt_score'\n",
    "model = smf.ols(formula, data=user)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\\n**(5) Trust Ratings of Social Media Platforms vs CRT\\n\")\n",
    "formula = 'trust ~ crt_score'\n",
    "model = smf.ols(formula, data=user)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\\n**(6) Willingness to Pay for KN95 Masks vs CRT\\n\")\n",
    "formula = 'willing_kn95_price ~ crt_score'\n",
    "model = smf.ols(formula, data=user)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\\n**(7) Masks Won vs CRT\\n\")\n",
    "formula = 'won_mask ~ crt_score'\n",
    "model = smf.ols(formula, data=user)\n",
    "results = model.fit()\n",
    "print(results.summary())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# <span style=\"color:blue\">Appendix Results</span>\n",
    "## Appendix C: Robustness Checks (Figure A)\n",
    "- Horizontal/coefficient plot with and without controls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 187,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler\n",
    "user_standard = user.copy()\n",
    "\n",
    "user_standard[['own_surgical_mask', 'own_kn95_mask', 'multiple_masks', 'crt_seen', 'nonsm_src','sm_src','gender','age','edu','income','crt_score','willing_kn95_price','trust','won_mask','trust_nonsm']] = StandardScaler().fit_transform(user_standard[['own_surgical_mask', 'own_kn95_mask', 'multiple_masks', 'crt_seen', 'nonsm_src','sm_src','gender','age','edu','income','crt_score','willing_kn95_price','trust','won_mask','trust_nonsm']])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "**(A) Trust Ratings of Formal Sources vs CRT (w/ controls) \n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:            trust_nonsm   R-squared:                       0.200\n",
      "Model:                            OLS   Adj. R-squared:                  0.193\n",
      "Method:                 Least Squares   F-statistic:                     29.90\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):           3.77e-27\n",
      "Time:                        14:10:24   Log-Likelihood:                -789.65\n",
      "No. Observations:                 604   AIC:                             1591.\n",
      "Df Residuals:                     598   BIC:                             1618.\n",
      "Df Model:                           5                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.0058      0.037      0.159      0.874      -0.066       0.078\n",
      "crt_score     -0.0783      0.038     -2.077      0.038      -0.152      -0.004\n",
      "age            0.0517      0.037      1.415      0.158      -0.020       0.123\n",
      "gender         0.4195      0.038     11.172      0.000       0.346       0.493\n",
      "edu            0.0344      0.037      0.935      0.350      -0.038       0.107\n",
      "income        -0.0465      0.037     -1.265      0.206      -0.119       0.026\n",
      "==============================================================================\n",
      "Omnibus:                        4.056   Durbin-Watson:                   1.856\n",
      "Prob(Omnibus):                  0.132   Jarque-Bera (JB):                3.151\n",
      "Skew:                          -0.041   Prob(JB):                        0.207\n",
      "Kurtosis:                       2.656   Cond. No.                         1.29\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "**(B) Truth Discernment vs CRT (w/ controls) \n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:                discern   R-squared:                       0.107\n",
      "Model:                            OLS   Adj. R-squared:                  0.100\n",
      "Method:                 Least Squares   F-statistic:                     14.78\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):           1.05e-13\n",
      "Time:                        14:10:25   Log-Likelihood:                 50.492\n",
      "No. Observations:                 621   AIC:                            -88.98\n",
      "Df Residuals:                     615   BIC:                            -62.40\n",
      "Df Model:                           5                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.7927      0.009     88.123      0.000       0.775       0.810\n",
      "crt_score      0.0423      0.009      4.589      0.000       0.024       0.060\n",
      "age           -0.0125      0.009     -1.381      0.168      -0.030       0.005\n",
      "gender        -0.0545      0.009     -5.895      0.000      -0.073      -0.036\n",
      "edu           -0.0011      0.009     -0.126      0.900      -0.019       0.017\n",
      "income         0.0136      0.009      1.494      0.136      -0.004       0.032\n",
      "==============================================================================\n",
      "Omnibus:                      143.601   Durbin-Watson:                   1.931\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):              277.335\n",
      "Skew:                          -1.313   Prob(JB):                     5.99e-61\n",
      "Kurtosis:                       4.956   Cond. No.                         1.29\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "**(C) Trust Ratings of Social Media Platforms vs CRT (w/ controls) \n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:                  trust   R-squared:                       0.007\n",
      "Model:                            OLS   Adj. R-squared:                 -0.001\n",
      "Method:                 Least Squares   F-statistic:                    0.8191\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):              0.536\n",
      "Time:                        14:10:25   Log-Likelihood:                -873.42\n",
      "No. Observations:                 617   AIC:                             1759.\n",
      "Df Residuals:                     611   BIC:                             1785.\n",
      "Df Model:                           5                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept     -0.0003      0.040     -0.007      0.995      -0.079       0.079\n",
      "crt_score      0.0779      0.041      1.885      0.060      -0.003       0.159\n",
      "age           -0.0156      0.040     -0.386      0.699      -0.095       0.064\n",
      "gender         0.0242      0.041      0.585      0.559      -0.057       0.106\n",
      "edu            0.0062      0.041      0.153      0.878      -0.074       0.086\n",
      "income         0.0170      0.041      0.418      0.676      -0.063       0.097\n",
      "==============================================================================\n",
      "Omnibus:                       12.496   Durbin-Watson:                   1.953\n",
      "Prob(Omnibus):                  0.002   Jarque-Bera (JB):                7.876\n",
      "Skew:                           0.115   Prob(JB):                       0.0195\n",
      "Kurtosis:                       2.497   Cond. No.                         1.28\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "**(D) Willingness to Pay for KN95 Masks vs CRT (w/ controls) \n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:     willing_kn95_price   R-squared:                       0.015\n",
      "Model:                            OLS   Adj. R-squared:                  0.007\n",
      "Method:                 Least Squares   F-statistic:                     1.928\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):             0.0878\n",
      "Time:                        14:10:25   Log-Likelihood:                -876.33\n",
      "No. Observations:                 621   AIC:                             1765.\n",
      "Df Residuals:                     615   BIC:                             1791.\n",
      "Df Model:                           5                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept  -1.128e-17      0.040  -2.82e-16      1.000      -0.079       0.079\n",
      "crt_score      0.0856      0.041      2.086      0.037       0.005       0.166\n",
      "age            0.0178      0.040      0.443      0.658      -0.061       0.097\n",
      "gender        -0.0722      0.041     -1.755      0.080      -0.153       0.009\n",
      "edu           -0.0019      0.040     -0.047      0.963      -0.081       0.078\n",
      "income        -0.0066      0.041     -0.163      0.870      -0.086       0.073\n",
      "==============================================================================\n",
      "Omnibus:                      723.778   Durbin-Watson:                   1.922\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):               59.683\n",
      "Skew:                           0.422   Prob(JB):                     1.10e-13\n",
      "Kurtosis:                       1.737   Cond. No.                         1.29\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "**(E) Masks Won vs CRT (w/ controls) \n",
      "\n",
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:               won_mask   R-squared:                       0.021\n",
      "Model:                            OLS   Adj. R-squared:                  0.013\n",
      "Method:                 Least Squares   F-statistic:                     2.584\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):             0.0251\n",
      "Time:                        14:10:25   Log-Likelihood:                -874.70\n",
      "No. Observations:                 621   AIC:                             1761.\n",
      "Df Residuals:                     615   BIC:                             1788.\n",
      "Df Model:                           5                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept  -8.066e-17      0.040  -2.02e-15      1.000      -0.078       0.078\n",
      "crt_score      0.0873      0.041      2.134      0.033       0.007       0.168\n",
      "age            0.0369      0.040      0.921      0.357      -0.042       0.116\n",
      "gender        -0.0816      0.041     -1.989      0.047      -0.162      -0.001\n",
      "edu           -0.0010      0.040     -0.025      0.980      -0.080       0.078\n",
      "income        -0.0425      0.040     -1.051      0.294      -0.122       0.037\n",
      "==============================================================================\n",
      "Omnibus:                     3927.613   Durbin-Watson:                   2.086\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):               98.751\n",
      "Skew:                           0.569   Prob(JB):                     3.60e-22\n",
      "Kurtosis:                       1.413   Cond. No.                         1.29\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n"
     ]
    }
   ],
   "source": [
    "# Different outcome variables vs CRT after controlling for age, gender, education, and household expenditure (proxy for income)\n",
    "# All variables have been standardized, mean-centered and scaled by standard deviation for comparability.\n",
    "# Results sorted from low to high in terms of effect sizes\n",
    "\n",
    "print(\"\\n\\n**(A) Trust Ratings of Formal Sources vs CRT (w/ controls) \\n\")\n",
    "formula = 'trust_nonsm ~ crt_score + age + gender + edu + income'\n",
    "model = smf.ols(formula, data=user_standard)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\\n**(B) Truth Discernment vs CRT (w/ controls) \\n\")\n",
    "formula = 'discern ~ crt_score + age + gender + edu + income'\n",
    "model = smf.ols(formula, data=user_standard)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\\n**(C) Trust Ratings of Social Media Platforms vs CRT (w/ controls) \\n\")\n",
    "formula = 'trust ~ crt_score + age + gender + edu + income'\n",
    "model = smf.ols(formula, data=user_standard)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\\n**(D) Willingness to Pay for KN95 Masks vs CRT (w/ controls) \\n\")\n",
    "formula = 'willing_kn95_price ~ crt_score + age + gender + edu + income'\n",
    "model = smf.ols(formula, data=user_standard)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\\n**(E) Masks Won vs CRT (w/ controls) \\n\")\n",
    "formula = 'won_mask ~ crt_score + age + gender + edu + income'\n",
    "model = smf.ols(formula, data=user_standard)\n",
    "results = model.fit()\n",
    "print(results.summary())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAArQklEQVR4nO3de7xVdZ3/8dcbBJFAETATU0nzMoZFckaNLpKXhIrUhFGHkkOTjKPRNOkvdWxC7WZZdkGr0SbBsjDQSi0wsziZl1S8HTWPkqJ2KBO8AB1ALp/fH+u7cbM9183eZ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6FYBg4v22YlXXsvQ2M4xS/0RODzdR+oHTO7gWFNftecrfg/8a4pxAlnTYE/O0+73kZL/z4BLyJr9VrRz3MHAX9Mxi+8HlV6XghZgpKTCdf0o0NTJZytc9+aI+ArZKOOF+4X7UdmR/LdJTlBmHSt0YChMF3Vjn08CDco6QjwCnJbKvwDsrNQRAXhvKr8ceFCv7iTRD/iapEcl3Q+cCPxnyTbHkjWlXVGIMZVPAf4tnedhXv0qdMh++N+uV6p2F6eb9w8Bt5ONVv07suax+1Mz4leBL0u6j260vkT2bq/zgTvImrL+VLT6fLJmyMXA8k4OcwHwHkkPkzWLPd3D83T0fUDWrPcR2m/eA/gfsuR3G/BoUflc4P+lTg37FMWxluze3jxJzWSvS++qV+Cn0t+JB4H1wIJU/l7gl13sW/c8mrnZa5SkbwE3RMRvah2LbUnS74Fju7pXWe9cgzJ77foSMLDWQdiW0n2xS17ryQlcgzIzs5xyDcrMzHLJCcrMzHLJCcrMzHLJCcrMzHLJCcrMzHLp/wMHnw1d4qJO9gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Effect sizes (OLS w/ controls for age, income, education, gender)\n",
    "x = [-0.0783, 0.0423, 0.0779, 0.0856, 0.0873]\n",
    "y = ['trust in formal sources', 'discernment', 'trust in social media', 'WTP','mask won']\n",
    "\n",
    "# CIs\n",
    "x_error = [0.0740, 0.0181, 0.0812, 0.0806, 0.0804]\n",
    "x_error_2 = [0.0621, 0.0152, 0.0681, 0.0676, 0.0674]\n",
    "plt.scatter(x,y)\n",
    "\n",
    "# Plot error bar\n",
    "plt.errorbar(x, y, xerr = x_error_2,fmt='o',ecolor = 'blue',color='black',linewidth=2.5)\n",
    "plt.errorbar(x, y, xerr = x_error,fmt='o',ecolor = 'blue',color='black',linewidth=1)\n",
    "plt.axvline(x=0, ymin=0, ymax=1, color='grey', linestyle='dotted', linewidth=3)\n",
    "plt.xlabel('Effect Size (standard deviations)')\n",
    "plt.ylabel('Variable')\n",
    "\n",
    "plt.grid(b=True, which='major', color='gray', alpha=0.3, lw=1)\n",
    "    \n",
    "# Display graph\n",
    "plt.tight_layout()\n",
    "plt.savefig('crt_hline_w_controls.png', dpi=400)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Appendix D: Additional Results \n",
    "### Figure B. Correlates of CRT Scores\n",
    "- Note: All variables are to be standardized, mean-centered and scaled by standard deviation for comparability (see below)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:              crt_score   R-squared:                       0.044\n",
      "Model:                            OLS   Adj. R-squared:                  0.043\n",
      "Method:                 Least Squares   F-statistic:                     28.71\n",
      "Date:                Sun, 26 Jun 2022   Prob (F-statistic):           1.19e-07\n",
      "Time:                        14:10:25   Log-Likelihood:                -867.08\n",
      "No. Observations:                 621   AIC:                             1738.\n",
      "Df Residuals:                     619   BIC:                             1747.\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept  -8.674e-19      0.039  -2.21e-17      1.000      -0.077       0.077\n",
      "gender        -0.2105      0.039     -5.358      0.000      -0.288      -0.133\n",
      "==============================================================================\n",
      "Omnibus:                      551.687   Durbin-Watson:                   2.036\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):               39.795\n",
      "Skew:                           0.052   Prob(JB):                     2.28e-09\n",
      "Kurtosis:                       1.764   Cond. No.                         1.00\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
      "\n",
      "\n",
      "Coeff: -0.21053414902382167\n",
      "95% CI one-sided 0.07716279775301477\n",
      "90% CI one-sided 0.06472731323578312\n"
     ]
    }
   ],
   "source": [
    "# For generating Appendix Figure B, run the regressions below one by one to find effect sizes.\n",
    "# PLEASE MAKE SURE YOU RUN ONE OF THE ABOVE CELLS TO STANDARDIZE VARIABLES\n",
    "\n",
    "#formula = 'crt_score ~ sm_src'\n",
    "#formula = 'crt_score ~ nonsm_src'\n",
    "#formula = 'crt_score ~ own_kn95_mask'\n",
    "#formula = 'crt_score ~ edu'\n",
    "#formula = 'crt_score ~ income'\n",
    "#formula = 'crt_score ~ age'\n",
    "#formula = 'crt_score ~ multiple_masks'\n",
    "#formula = 'crt_score ~ own_surgical_mask'\n",
    "formula = 'crt_score ~ gender'\n",
    "\n",
    "model = smf.ols(formula, data=user_standard)\n",
    "results = model.fit()\n",
    "print(results.summary())\n",
    "\n",
    "print(\"\\n\")\n",
    "print(\"Coeff:\", results.params[1])\n",
    "print(\"95% CI one-sided\", results.params[1]-results.conf_int(0.05)[0][1])\n",
    "print(\"90% CI one-sided\", results.params[1]-results.conf_int(0.1)[0][1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAA8aUlEQVR4nO3de3wU1f3/8dc7AUQKeAFriReoVrHWC4VovROrVqLFK6m1VAi18rUi1lbbam+C9mJra2uB1qI/G2ipWiitVAW0ViJSLxBFg0q8ojZYKygCBhDI5/fHnIVl2SSbZDc7ST7Px2MemT0zc85nZzf72XNmdkZmhnPOORc3BfkOwDnnnEvHE5RzzrlY8gTlnHMuljxBOeeciyVPUM4552KpS74DcJ1D3759bcCAAWmXbdy4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VPUM61jQLgGDPbmFyoFty/z6Kv0k8CT0p6kOjDdEJKvYeFspNCUisA1mSQWDcQJZxEW5dK+gxRL6VK0pA029wAPGxm5yq6rfuCpGXJV+PeStOfOZOAm81sjqSSlOf1QRPbNkdDr8djwCck7UV0TOlHabatAM4xs2cklQMlrYwlsY+27R8zu1HSfUTXx1sk6XQzW07UG9uQvpqOx49BOdc2HgDGJx5IGhRmHyT6Np0o3yPMbpaU3BNJLC+SNDipaBDR0FnyOrsDdwKjEr0Hi+6G+pqksrCOJB2ZJs4XgE8k1XWgmT1h0QH/d4iG6NYBvZK22Y3tt2YoT1NnqieAoeE4UlegrIG6GrvX0CPAl0KMpURDg81pJ+3rEZL/34CbiYb90t0epBfwVqgz+XhQ6n5JqAEGSErs14uAykaeW2K/V5vZz4iuNJ44XngwsKyxbTsST1DONV/iBIbEdGMG21wBFCs6EeJ54NJQ/iNgD4UTEYCTQ/lU4FntfJJEV+AXkpZLWgpcAHw9ZZ2ziYbSbkvEGMpHAheHdp5j51u0Q/TB/2lt79rdFA7eLwP+TXR1+YeJhseWhmHEnwM/lfQ0GYzKWHRn4AnAY0RDWS8kLZ5ANAxZBaxqpJqJwEmSniMaFnujme009HpANKz3ZdIP7wH8gCj5LQKWJ5XfBXwrnNRwYFIcG4mO7c2UVE10q/mmzgq8MrwnniW6en7izronE92LrFPwq5k753Yg6RbgH2b2z3zH4nYk6RHg7KaOVXYU3oNyzqX6CdAj30G4HYXjYjd3luQE3oNyzjkXU96Dcs45F0ueoJxzzsWSJyjnnHOx5AnKOedcLHmCcs45F0v/H5tGq3k4I6vvAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "y = ['freq. on social media', 'freq. formal sources', 'KN95 mask ownership',\\\n",
    "      'education', 'income','age', 'multiple mask ownership', 'surgical mask owernship', 'gender']\n",
    "x = [0.256, 0.123, 0.075, 0.0354, -0.0155, -0.0513, -0.0609, -0.0849, -0.2105]\n",
    "\n",
    "x_error = [0.0763, 0.0787, 0.0787, 0.0788, 0.0789, 0.0788, 0.0788, 0.0786, 0.0771]\n",
    "x_error_2 = [0.0640, 0.0660, 0.0660, 0.0661, 0.0662, 0.0661, 0.0661, 0.0660, 0.0647]\n",
    "plt.scatter(x,y)\n",
    "\n",
    "plt.errorbar(x, y, xerr = x_error_2,fmt='o',ecolor = 'blue',color='black',linewidth=2.5)\n",
    "plt.errorbar(x, y, xerr = x_error,fmt='o',ecolor = 'blue',color='black',linewidth=1)\n",
    "plt.axvline(x=0, ymin=0, ymax=1, color='grey', linestyle='dotted', linewidth=3)\n",
    "plt.xlabel('Effect Size (standard deviations)')\n",
    "plt.ylabel('Variable')\n",
    "\n",
    "plt.grid(b=True, which='major', color='gray', alpha=0.3, lw=1)\n",
    "    \n",
    "# Display graph\n",
    "plt.tight_layout()\n",
    "plt.savefig('crt_correlates.png', dpi=400)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Figure C. Relationship of CRT scores with (a) frequency of use of formal information sources and (b) social media platforms\n",
    "### (i) Mean use frequency of formal sources vs CRT (left plot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.22227836888829794\n",
      "0.267316735792531\n",
      "0.24901960780213897\n"
     ]
    }
   ],
   "source": [
    "grp = user.groupby('crt_score')\n",
    "grp_mean = grp.agg({'nonsm_src':'mean'})\n",
    "\n",
    "crt_a_mean = grp.get_group(0)['nonsm_src'].mean()\n",
    "crt_b_mean = grp.get_group(0.5)['nonsm_src'].mean()\n",
    "crt_c_mean = grp.get_group(1)['nonsm_src'].mean()\n",
    "\n",
    "print(grp.get_group(0)['nonsm_src'].mean())\n",
    "print(grp.get_group(0.5)['nonsm_src'].mean())\n",
    "print(grp.get_group(1)['nonsm_src'].mean())\n",
    "\n",
    "ci_a = crt_a_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0)['nonsm_src'].count()-1, loc=np.nanmean(grp.get_group(0)['nonsm_src']), scale=stats.sem(grp.get_group(0)['nonsm_src'], nan_policy='omit'))[0]\n",
    "ci_b = crt_b_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0.5)['nonsm_src'].count()-1, loc=np.nanmean(grp.get_group(0.5)['nonsm_src']), scale=stats.sem(grp.get_group(0.5)['nonsm_src'], nan_policy='omit'))[0]\n",
    "ci_c = crt_c_mean - stats.t.interval(alpha=0.95, df=grp.get_group(1)['nonsm_src'].count()-1, loc=np.nanmean(grp.get_group(1)['nonsm_src']), scale=stats.sem(grp.get_group(1)['nonsm_src'], nan_policy='omit'))[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 160,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAD0CAYAAADOibL4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgm0lEQVR4nO3de7gdZX328e9NOKNYqKFKAEkgqEExwA6HaiEgSAAbQAMELhBEG7CgWK6C+EohxKLUWt5qgRZeiYBCIlKBLXKQU4LWKtmQCCaUEgJIUqghoJwkIcn9/jGzw8pmZ+/JYVbW3vv+XNe69swzz8z8ltfCX2bmmd8j20RERLSaDdZ3ABEREd1JgoqIiJaUBBURES0pCSoiIlpSElRERLSkJKiIiGhJtSYoSWMkPSZprqRzu9l+mqRHJM2S9HNJI8r2HSX9sWyfJenf6owzIiJaj+p6D0rSIOC/gYOB+cAM4Djbcxr6bGn7pXJ5LPDXtsdI2hG41fYHagkuIiJaXp1XUHsBc23Ps70EmAoc0dihMzmVtgDy1nBERACwYY3HHgI807A+H9i7aydJpwNnARsDBzZsGippJvAScJ7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bSjpD+WlcfnSLpW0p81VCN/TtKChvWNuxz3FEmPlKWNfiMptfliwKhtyveIgUKSgJuAa2yPL9s+BPwZRW29J2yPLKuV3wUcZHtk2W8i8Irtb3Zz3O2ArwB72P6DpLcBg9cy1g3L960iWl6uoCLW3gHAG7b/rbPB9q9t/6yxk+1lwANULw68DfAyxRQK2H7F9pMAknaWdLekX0t6SNJOKvxjeaX1iKRjy76jJf1MUjswR9Kgst+M8srs1LX+XyCiBrmCilh7HwAe7K2TpE2BvYEzKx7318D/Ak9Kugf4ke0fl9uuAy62fVN53A2ATwAjgQ8B7wRmSLq/7L8H8AHbT0qaAPzB9ihJmwD/IemnnckvolXkCiqifjtJmkWRbJ61/XCVncorrjHAOIqJDP+vpImS3g4MsX1T2e91268BHwGm2F5m+3+B6cCo8nAPNCSgjwGfKmP6FfCnwPB18D0j1qkkqIi1N5ueq4o/UT5z2gnYs6GuXq9ceMD21ymKx35yDWN8tWFZwOdtjyw/Q23/dA2PG1GbJKiItXcvsEl56wwASbtJ+ovGTrafB84FvlzloJK2lbRHQ9NI4GnbLwPzJR1Z9ttE0ubAz4Bjy2dMg4H9KJ55dXUn8DlJG5X77yJpi2pfNaJ5kqAi1pKListHAQeVw8xnA18Hnuum+83A5l2T1ypsBHxT0n+Vt+OO5c3nVydSVDZ/GPgF8C6KkYQPUzy7uhc4x3Z3MXwHmAM8JOk3wBXkeXS0oFQzj4iIlpQrqIiIaElJUBER0ZKSoCIioiUlQUVEREtKgoqIiJaUBBURES0pCSoiIlrS/wfTrDqx1SSvxgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x252 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def addlabels(x,y):\n",
    "    for i in range(len(x)):\n",
    "        plt.text(i+0.4, y[i]+0.025, y[i], ha = 'center')\n",
    "\n",
    "crt_a_mean = round(crt_a_mean,2)\n",
    "crt_b_mean = round(crt_b_mean,2)\n",
    "crt_c_mean = round(crt_c_mean,2)\n",
    "\n",
    "usable1 = {'crt':['0', '0.5', '1'],\n",
    "        'discern': [crt_a_mean, crt_b_mean, crt_c_mean],\n",
    "         'ci': [ci_a, ci_b, ci_c]}\n",
    " \n",
    "new_colors1 = ['red','blue','green']\n",
    "\n",
    "barWidth = 0.4\n",
    "r1 = np.arange(len(usable1))\n",
    "r2 = [x + barWidth for x in r1]\n",
    "    \n",
    "plt.figure(figsize=(6,3.5))\n",
    "barh = plt.bar(r2, usable1['discern'], width = barWidth, yerr=usable1['ci'],color=new_colors1,alpha=0.5, align='center',capsize=5)\n",
    "\n",
    "# general layout\n",
    "plt.xticks([r + barWidth for r in range(len(usable1))], ['0', '0.5', '1'])\n",
    "plt.ylabel('height')\n",
    "\n",
    "x = usable1['crt']\n",
    "y = usable1['discern']\n",
    "addlabels(x, y)\n",
    "plt.ylim(0.0,0.35)\n",
    "\n",
    "plt.xlabel('CRT Score')\n",
    "plt.ylabel('Mean Use Frequency of Formal Sources')\n",
    "plt.tight_layout()\n",
    "plt.savefig('crt_formal_freq_use.png', dpi=400)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### (ii) Mean Use Frequency of Social Media vs CRT (right plot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6305555555555556"
      ]
     },
     "execution_count": 161,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grp = user.groupby('crt_score')\n",
    "grp_mean = grp.agg({'sm_src':'mean'})\n",
    "\n",
    "crt_a_mean = grp.get_group(0)['sm_src'].mean()\n",
    "crt_b_mean = grp.get_group(0.5)['sm_src'].mean()\n",
    "crt_c_mean = grp.get_group(1)['sm_src'].mean()\n",
    "\n",
    "crt_a_mean\n",
    "crt_c_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.498888888888889\n",
      "0.623137860082304\n",
      "0.6305555555555556\n"
     ]
    }
   ],
   "source": [
    "grp = user.groupby('crt_score')\n",
    "grp_mean = grp.agg({'sm_src':'mean'})\n",
    "\n",
    "crt_a_mean = grp.get_group(0)['sm_src'].mean()\n",
    "crt_b_mean = grp.get_group(0.5)['sm_src'].mean()\n",
    "crt_c_mean = grp.get_group(1)['sm_src'].mean()\n",
    "\n",
    "print(grp.get_group(0)['sm_src'].mean())\n",
    "print(grp.get_group(0.5)['sm_src'].mean())\n",
    "print(grp.get_group(1)['sm_src'].mean())\n",
    "\n",
    "ci_a = crt_a_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0)['sm_src'].count()-1, loc=np.mean(grp.get_group(0)['sm_src']), scale=stats.sem(grp.get_group(0)['sm_src']))[0]\n",
    "ci_b = crt_b_mean - stats.t.interval(alpha=0.95, df=grp.get_group(0.5)['sm_src'].count()-1, loc=np.mean(grp.get_group(0.5)['sm_src']), scale=stats.sem(grp.get_group(0.5)['sm_src']))[0]\n",
    "ci_c = crt_c_mean - stats.t.interval(alpha=0.95, df=grp.get_group(1)['sm_src'].count()-1, loc=np.mean(grp.get_group(1)['sm_src']), scale=stats.sem(grp.get_group(1)['sm_src']))[0]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAD0CAYAAADOibL4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAfGElEQVR4nO3de5xWZb338c9XEEyzRB1PzJCcpAYktg6i2woqCcIazdiP4MsD2wPVA+rOrGzXpoGdaWr2PCY7IzM8JfFobrHYKB1ALR85KKLgFgg0BinFLCPNEfjtP9YavGecw5qBNXPP3N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HsbaM33fyqxL8R2UWft8GHgzIm6qL4iIJyPi4cJKEbETWEb2SYIPA/5KsnQCEbE9IjYBSBok6ReSnpT0uKSBSlyb3mk9JenMtO4YSQ9LWgCsldQjrbc8vTP7zB7/EzDLme+gzNpnGLCytUqS9gNGAZdmbPdJ4I/AJkm/BH4aEfenx+4Ero6Ie9N29wHOAEYA7wcOBZZLeiitfxwwLCI2SZoK/CUiRkrqDfxG0oP1yc+sGPkOyiwfAyWtIkk2WyNidZaT0juu8cBEkoUMvyOpRtKBQN+IuDet9/eIeA34AHBXROyMiD8CS4GRaXPLChLQx4Bz05geAw4BBu+F72mWGycos/ZZQ8uziv8ufeY0EDi+YF69VkViWURcRTJ57KfbGePfCrYFXBwRI9JP/4h4sJ3tmnUIJyiz9vkV0DvtOgNA0nBJHyysFBHbgCuAr2RpVNJRko4rKBoBPB8RfwVqJZ2e1ustaX/gYeDM9BlTGfAhkmdejT0AfE7Svun5x0g6INtXNescTlBm7RDJLMufAk5Jh5mvAa4C/tBE9f8E9m+cvJqxL3CdpP9Ou+PO5K3nV+eQzGy+GvgtcATJSMLVJM+ufgV8KSKaiuFmYC3wuKSnge/jZ9BW5DybuZmZFSXfQZmZWVFygjIzs6LkBGVmZkXJCcrMzIqSE5SZmRUlJygzMytKTlBmZlaU/gf0QQVwQmjKogAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x252 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def addlabels(x,y):\n",
    "    for i in range(len(x)):\n",
    "        plt.text(i+0.4, y[i]+0.06, y[i], ha = 'center')\n",
    "\n",
    "crt_a_mean = round(crt_a_mean,2)\n",
    "crt_b_mean = round(crt_b_mean,2)\n",
    "crt_c_mean = round(crt_c_mean,2)\n",
    "\n",
    "usable1 = {'crt':['0', '0.5', '1'],\n",
    "        'discern': [crt_a_mean, crt_b_mean, crt_c_mean],\n",
    "         'ci': [ci_a, ci_b, ci_c]}\n",
    " \n",
    "new_colors1 = ['red','blue','green']\n",
    "\n",
    "barWidth = 0.4\n",
    "r1 = np.arange(len(usable1))\n",
    "r2 = [x + barWidth for x in r1]\n",
    "    \n",
    "plt.figure(figsize=(6,3.5))\n",
    "barh = plt.bar(r2, usable1['discern'], width = barWidth, yerr=usable1['ci'],color=new_colors1,alpha=0.5, align='center',capsize=5)\n",
    "\n",
    "# general layout\n",
    "plt.xticks([r + barWidth for r in range(len(usable1))], ['0', '0.5', '1'])\n",
    "plt.ylabel('height')\n",
    "\n",
    "x = usable1['crt']\n",
    "y = usable1['discern']\n",
    "addlabels(x, y)\n",
    "plt.ylim(0.0,0.8)\n",
    "\n",
    "plt.xlabel('CRT Score')\n",
    "plt.ylabel('Mean Use Frequency of Social Media')\n",
    "plt.tight_layout()\n",
    "plt.savefig('crt_sm_freq_use.png', dpi=400)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
